package com.dong.environment;

import org.springframework.core.env.PropertySource;
import org.springframework.core.env.PropertySources;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

/**
 * description
 *
 * @author Administrator 2021/09/06 16:16
 */
public class MyPropertySource extends PropertySource<Map<String,String>> {

    public MyPropertySource(String name, Object source) {
        super(name, (Map<String, String>) source);
    }

    @Override
    public Object getProperty(String s) {
        return this.getResource().get(s);
    }

    private Map<String,String> getResource(){
        Map<String,String> map = new HashMap<>();
        map.put("user","jerry");
        return map;
    }
}
